#if UNITY_EDITOR
using System.Collections.Generic;
using Sirenix.OdinInspector;
using Pangoo.Common;

namespace MetaTable
{
    public class MetaTableDetailRowWrapper<TOverview, TRow> : MetaTableWrapperBase<TOverview, TRow>
                        where TOverview : MetaTableOverview
                        where TRow : MetaTableUnityRow, new()
    {

        public override bool CanNameChange => true;

        public IMetaTableEditor Editor { get; set; }
        
        private GitTracer _gitTracer;
        
        [TabGroup("Tabs","辅助工具")]
        [FoldoutGroup("Tabs/辅助工具/Git")]
        [PropertyOrder(100)]
        [HideLabel]
        [HideReferenceObjectPicker]
        [ShowInInspector]
        public GitTracer GitTracer
        {
            get
            {
                var entries = GitEntries;
                if (entries == null) return null;
                
                if (_gitTracer == null)
                {
                    _gitTracer = new GitTracer();
                    _gitTracer.SetGitEntry(entries);
                    _gitTracer.OnUpdateEditorHandler = Refresh;
                    _gitTracer.UpdateAction = (() => _gitTracer.SetGitEntry(GitEntries));
                }
                return _gitTracer;
            }
            set
            {
                
            }
        }

        public virtual void Refresh(){}
        
        public virtual  List<GitEntry> GitEntries => null;


    }
}

#endif